
package com.company.bkst.service;

import java.util.ArrayList;

import javax.jws.WebService;

import com.company.bkst.Book;
import com.company.bkst.Order;
import com.company.bkst.dao.BookDAO;
import com.company.bkst.dao.OrderDAO;
import com.company.bkst.service.request.BookRequest;
import com.company.bkst.service.request.OrderRequest;
import com.sun.xml.bind.v2.runtime.unmarshaller.XsiNilLoader.Array;

@WebService(endpointInterface = "com.company.bkst.service.OrderServiceSEI", portName = "OrderServicePort", serviceName = "OrderServices")
public class OrderService implements OrderServiceSEI {
	
	public Order getOrderByID(OrderRequest orderRequest) {
		OrderDAO dao = new OrderDAO();
		return dao.getOrderByID(orderRequest.getOrder().getOrderID());
	}
	
	public Boolean createOrder(OrderRequest orderRequest){
		OrderDAO dao = new OrderDAO();
		return dao.saveOrder(orderRequest.getOrder());
	}


	public Book getBook(BookRequest bookRequest) {
		BookDAO dao = new BookDAO();
		return dao.getBook(bookRequest.getBookID());
	}

	public ArrayList<Order> getAllOrders() {
		OrderDAO dao = new OrderDAO();
		return dao.getAllOrders();
	}



}
